<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Vue的双向数据绑定</title>
    <script src="js/jquery-1.12.4.js"></script>
    <script src="js/vue.js"></script>
</head>
<body>
<div id="app">
    <!-- v-model 双向数据绑定的实现-->
    <input type="text" v-model="msg">
    <input type="text" v-bind:value="name" v-on:input="valueChange">
    <h2>{{msg}}</h2>
    <h2>{{name}}</h2>
</div>

<script>
    new Vue({
        el:"#app",
        data(){
            return{
                msg:'靓仔',
                name:'华斯',
            }
        },
        methods:{
            valueChange(e){
                this.name=e.target.value;
            }
        }
    });
</script>
</body>
</html>